package com.github.chirspan.xaas.soa.message.xml.namespace;

import javax.xml.namespace.NamespaceContext;
import java.util.Iterator;
import java.util.Map;

public class MapNamespaceContext implements NamespaceContext {

    private final Map<String, String> pairs;

    public MapNamespaceContext(Map<String, String> nsMap) {
        pairs = nsMap;
    }

    @Override
    public String getNamespaceURI(String prefix) {
        return pairs.get(prefix);
    }

    @Override
    public String getPrefix(String namespaceURI) {
        throw new UnsupportedOperationException("getPrefix");
    }

    @Override
    public Iterator getPrefixes(String namespaceURI) {
        throw new UnsupportedOperationException("getPrefixs");
    }

}
